The default drawing mode of VectorScript is absolute mode. In absolute mode, values passed as parameters for drawing or positioning objects are assumed to be actual coordinate values relating to the VectorWorks coordinate system. For example:
In relative mode, values are assumed to be relative offsets from the current drawing pen position in the active document. Using the example above:
If the pen position prior to the call was (4',2'), the call would draw a rectangle with its top left corner located at (
4',4') and its bottom right corner located at
(6',2'). Additional drawing calls while in this mode would be relative to the last function call which positioned the drawing pen.
VectorScript uses two calls, Absolute() and
Relative(), to explicitly set the drawing mode of the document. These calls can be used to set the document draw mode and draw objects using offset rather than absolute values. For example:
will draw a square polygon 1" on a side with the lower left corner located at (2",2"). The same calls made without a call to
Relative() will draw a different polygon using absolute coordinate locations.
Once the relative mode is set, it will remain active until a call to Absolute() or when the script finishes execution. Be sure to reset the drawing mode to the desired state in order to ensure correct results from your script.